package com.spring.tools;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by ${Spring} on 2017/7/18.
 */
public class Controller extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse rep)throws ServletException{
        doGet(req,rep);
    }
    @Override
    protected void doPost(HttpServletRequest req,HttpServletResponse rep)throws ServletException,IOException{
        rep.setCharacterEncoding("UTF-8");
        String name = req.getParameter("name");
        System.out.println(name);
        req.getRequestDispatcher("index.jsp").forward(req,rep);
    }
}
